From 34c63b8e4f5068e855283e54bf76233a4e575a59 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 17 Jan 2018 19:49:52 -0500 Subject: [PATCH] glarea: Drop the dispose vfunc This was causing us to leak, in the following scenario: 1) gtk_widget_destroy is called on a GL area 2) dispose is run and clears the context 3) the GL area is unrealized, but the context is already cleared, so we leak all the GL buffers --- gtk/gtkglarea.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/gtk/gtkglarea.c b/gtk/gtkglarea.c index 22348ee01c..f6254cf8a4 100644 --- a/gtk/gtkglarea.c +++ b/gtk/gtkglarea.c @@ -201,17 +201,6 @@ static guint area_signals[LAST_SIGNAL] = { 0, }; G_DEFINE_TYPE_WITH_PRIVATE (GtkGLArea, gtk_gl_area, GTK_TYPE_WIDGET) -static void -gtk_gl_area_dispose (GObject *gobject) -{ - GtkGLArea *area = GTK_GL_AREA (gobject); - GtkGLAreaPrivate *priv = gtk_gl_area_get_instance_private (area); - - g_clear_object (&priv->context); - - G_OBJECT_CLASS (gtk_gl_area_parent_class)->dispose (gobject); -} - static void gtk_gl_area_set_property (GObject *gobject, guint prop_id, @@ -891,7 +880,6 @@ gtk_gl_area_class_init (GtkGLAreaClass *klass) gobject_class->set_property = gtk_gl_area_set_property; gobject_class->get_property = gtk_gl_area_get_property; - gobject_class->dispose = gtk_gl_area_dispose; gobject_class->notify = gtk_gl_area_notify; g_object_class_install_properties (gobject_class, LAST_PROP, obj_props); -- 2.30.2